Profile-guided optimization

Profile-guided optimization (PGO, sometimes pronounced as “pogo”[1]) is a compiler optimization technique in computer programming to improve program runtime performance. In contrast to traditional optimization techniques that solely use the source code, PGO uses the results of test runs of the instrumented program to optimize the final generated code. The compiler is used to access data from a sample run of the program across a representative input set. The data indicates which areas of the program are executed more frequently, and which areas are executed less frequently. All optimizations benefit from profile-guided feedback because they are less reliant on heuristics when making compilation decisions. The caveat, however, is that the sample of data fed to the program during the profiling stage must be statistically representative of the typical usage scenarios; otherwise, profile-guided feedback has the potential of harming the overall performance of the final build instead of improving it.

Implementations

Examples of compilers that implement PGO are the Intel C++ Compiler and Fortran compilers, GNU Compiler Collection compilers, Sun Studio, and the Microsoft Visual C++ Compiler.

References

  1. ^ "Microsoft Visual C++ Team Blog". http://blogs.msdn.com/vcblog/archive/2008/11/12/pogo.aspx.